﻿#include "HRibbonElementManager.h"


HRibbonElementManager::HRibbonElementManager() : m_delegate(nullptr)
{
    m_delegate = new HRibbonElementCreateDelegate();
}


HRibbonElementManager::~HRibbonElementManager()
{
    if (m_delegate) {
        delete m_delegate;
    }
    m_delegate = nullptr;
}


HRibbonElementManager *HRibbonElementManager::instance()
{
    static HRibbonElementManager s_instance;

    return (&(s_instance));
}


HRibbonElementCreateDelegate *HRibbonElementManager::delegate()
{
    return (m_delegate);
}


void HRibbonElementManager::setupDelegate(HRibbonElementCreateDelegate *delegate)
{
    if (m_delegate) {
        delete m_delegate;
    }
    m_delegate = delegate;
}
